package com.example.excelreader.util;

import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

public class ExcelUtil {
    public static void checkSuffix(String filename) {
        String[] split = StringUtils.split(filename, ".");
        Assert.state((split != null && split.length == 2), "文件名有误，请查核:" + filename);
        Assert.state(("xls".equals(split[1]) || "xlsx".equals(split[1])), "文件类型有误，请查核:" + filename);
    }

}
